package com.kly.enums;

/**
 * 0-购买 1-已取消 2-待处理
 * @author linqu
 */
public enum GooglePayPurchasesStatus {
    PURCHASES_SUCCESS(0, "PURCHASES SUCCESS"),

    CANCELED(1, "CANCELED"),

    PENDING(2, "PENDING"),

    OTHER(4, "OTHER"),

    ;
    private Integer status;
    private String description;

    GooglePayPurchasesStatus(Integer status, String description) {
        this.status = status;
        this.description = description;
    }

    public static GooglePayPurchasesStatus fromType(Integer status) {

        for (GooglePayPurchasesStatus orderStatus : values()) {
            if (orderStatus.getStatus().equals(status)) {
                return orderStatus;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
